<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
Route::prefix('')->group(function() {
    Route::post('visitor/login', [\App\Http\Controllers\Api\VisitorController::class, 'login']);
    Route::post('operator/login', [\App\Http\Controllers\Api\OperatorController::class, 'login']);
    Route::get('apply/info', [\App\Http\Controllers\Api\ApplyController::class, 'info']);
    Route::post('apply/come-register', [\App\Http\Controllers\Api\ApplyController::class, 'comeRegister']);
    Route::post('apply/go-register', [\App\Http\Controllers\Api\ApplyController::class, 'goRegister']);
});
Route::prefix('')->middleware('verify.mini')->group(function() {
    Route::post('visitor/perfect', [\App\Http\Controllers\Api\VisitorController::class, 'perfect']);
    Route::get('apply/lists', [\App\Http\Controllers\Api\ApplyController::class, 'lists']);
    Route::get('apply/init', [\App\Http\Controllers\Api\ApplyController::class, 'init']);
    Route::post('apply/add', [\App\Http\Controllers\Api\ApplyController::class, 'add']);
    Route::post('apply/cancel', [\App\Http\Controllers\Api\ApplyController::class, 'cancel']);
    Route::get('visitor/info', [\App\Http\Controllers\Api\VisitorController::class, 'info']);
});
